package com.shiguiwu.springmybatis.websocket.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

/**
 * @description: config  开启WebSocket支持
 * @author: stone
 * @date: Created by 2022/3/14 19:49
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.websocket.config
 */
@Configuration
public class WebSocketConfig {

    /**
     * 该Bean会自动注册使用@ServerEndpoint注解申明的websocket endpoint
     * @return
     */
    @Bean
    @ConditionalOnProperty(prefix = "spring.ldap",name = "disable",havingValue = "true")
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }

}
